<style>
    ol{
        list-style: none;
    }
</style>
<title>Menu | Add</title>
<h2>Menu</h2>
<div id="view-content">
    <div class="row-fluid">
        <div class="span3 well">
            <h3>Add New</h3> <hr>
            <?= $this->form ?>
        </div>
        <div class="span5 well">
            <h3>Full Menu</h3>
<!--            <pre>
            <?php
            print_r($this->fullMenu);
            ?>
            </pre>-->
            <?php
            if (sizeof($this->fullMenu) > 0) {
                echo "<ol>";
                foreach ($this->fullMenu as $parent) {
                    echo "<li>";
                    $classP = "alert alert-success";
                    if (!$parent['parent']['visible']) {
                        $classP = "alert alert-error";
                    }
                    $perentLink = $this->url(array('id' => $parent['parent']['id']), 'menu-update');
                    echo "<div class='$classP'>" . $parent['parent']['name'] . "&nbsp; <a href='$perentLink'><i class='icon-pencil'></i></a></div>";
                    if (sizeof($parent['child']) > 0) {
                        echo "<ol>";
                        foreach ($parent['child'] as $child) {
                            echo "<li>";
                            $classC = "alert alert-success";
                            if (!$child['visible']) {
                                $classC = "alert alert-error";
                            }
                            $childLink = $this->url(array('id' => $child['id']), 'menu-update');
                            echo "<div class='$classC'>" . $child['name'] . "&nbsp; <a href='$childLink'><i class='icon-pencil'></i></a></div></li>";
                        }
                        echo "</ol>";
                    }
                    echo "</li>";
                }
                echo "</ol>";
            }
            ?>

        </div>
    </div>
</div>